/*
package com.mcb_wxc.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.xfj_wxc.config.SysConfigure;
import com.xfj_wxc.entity.*;
import com.xfj_wxc.entity.vo.*;
import com.xfj_wxc.http.HttpRequester;
import com.xfj_wxc.http.HttpRespons;
import com.xfj_wxc.mapper.*;
import com.xfj_wxc.util.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.servlet.http.HttpServletRequest;
import java.security.spec.AlgorithmParameterSpec;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

*/
/**
 * Created by 小生
 * 2019/1/8 9:30.
 * 小程序开发
 *//*

@Api(tags = "USER", description = "用户")
@RestController
@RequestMapping(value="/userService")
@Slf4j
public class UserServiceWx {
    @Autowired
    private SysConfigure sysConfigure;
    @Autowired
    HttpServletRequest request;
    @Autowired
    TUserMapper tUserMapper;
    @Autowired
    TAgentWxMapper tAgentWxMapper;
    @Autowired
    TUserApplyLogMapper tUserApplyLogMapper;
    @Autowired
    TConsultantMapper tConsultantMapper;
    @Autowired
    TUserVisitLogMapper tUserVisitLogMapper;
    @Autowired
    TProjectMapper tProjectMapper;
    @Autowired
    TProjectDataMapper tProjectDataMapper;
    @Autowired
    TProjectHouseTypeMapper tProjectHouseTypeMapper;
    @Autowired
    TBaseConfigMapper tBaseConfigMapper;





    //https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx450c53a7767d82d0&secret=f4d8387512e47e0c211b349664560107

    */
/**
     * @api {GET} /userService/getUserById 通过id查询用户信息
     * @apiName getUserById
     * @apiGroup user
     * @apiDescription 通过id查询用户信息
     * @apiVersion 1.0.0
     * @apiParam {Integer} userId  用户id
     * @apiSuccess {JsonObject} result 返回对象
     * @apiSuccess {Integer} result.resultCode 调用是否成功, 1 是 0 否.
     * @apiSuccess {String} result.content 返回的描述性话语, 当resultCode为0时输出异常信息
     *//*

    @GetMapping("/getUserById")
    public String getUserById(Integer userId){
        ReturnJsonResultUtil result = new ReturnJsonResultUtil();
        try{
            TUser tUser = tUserMapper.selectByPrimaryKey(userId);
            result.setMainData(tUser);
        }catch (Exception e) {
            result.printLog(request,e);
            result.setResultCode(CodeUtil.FAIL);
            result.setContent(CodeUtil.SERVER_ERROR);
        }
        return result.toString();
    }

    */
/**
     * @api {GET} /userService/getWxOpenId 通过code查询微信用户openid
     * @apiName getWxOpenId
     * @apiGroup user
     * @apiDescription 通过code查询微信用户openid
     * @apiVersion 1.0.0
     * @apiParam {String} code  微信用户code
     * @apiSuccess {JsonObject} result 返回对象
     * @apiSuccess {Integer} result.resultCode 调用是否成功, 1 是 0 否.
     * @apiSuccess {String} result.content 返回的描述性话语, 当resultCode为0时输出异常信息
     *//*

    @ApiOperation(value="getWxOpenId", notes="通过code查询微信用户openid" , httpMethod = "GET", response = ProjectService.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "code",value = "code",required = true,dataType = "String",paramType="query"),
    })
    @GetMapping("/getWxOpenId")
    public String getWxOpenId(String code){
        ReturnJsonResultUtil result = new ReturnJsonResultUtil();
        Map<String, Object> resultMap = new HashMap<String, Object>();
        try{
            if(code == null) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("参数错误！");
                return result.toString();
            }
            //获取appid和secret
            String customerWxAppInfo = BaseConfigUtil.getConfigVal(tBaseConfigMapper,"customer_wx_app_info");
            if(StringUtil.empty(customerWxAppInfo)) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("没配置微信appid和secret！");
                return result.toString();
            }
            JSONObject customerWxAppJson = JSON.parseObject(customerWxAppInfo);
            String appid = customerWxAppJson.getString("appid");
            String appsercert = customerWxAppJson.getString("appsercert");
            String url = "https://api.weixin.qq.com/sns/jscode2session?appid="+appid+"&secret="+appsercert+"&js_code="+code+"&grant_type=authorization_code";
            HttpRequester http = new HttpRequester();
            HttpRespons respons = http.sendGet(url);
            JSONObject jsonObject = JSONObject.parseObject(respons.getContent()); // 转换成JSONObject对象
            Map<String, Object> datamap = jsonObject;

            TAgentWx tAgentWx = new TAgentWx();
            tAgentWx.setOpenid(datamap.get("openid")+"");
            List<TAgentWx> tAgentWxs = tAgentWxMapper.select(tAgentWx);
            if(tAgentWxs == null || tAgentWxs.size() == 0) {
                tAgentWx.setIsAuth(0);
                tAgentWxMapper.insert(tAgentWx);
                resultMap.put("userInfo", tAgentWx);
            }else {
                resultMap.put("userInfo", tAgentWxs.get(0));
            }
            resultMap.put("wxInfo", datamap);
            result.setMainData(resultMap);
        }catch (Exception e) {
            result.printLog(request,e);
            result.setResultCode(CodeUtil.FAIL);
            result.setContent(CodeUtil.SERVER_ERROR);
        }
        return result.toString();
    }

    */
/**
     * @api {POST} /userService/onLogin 用户授权登录
     * @apiName onLogin
     * @apiGroup user
     * @apiDescription  用户授权登录
     * @apiVersion 1.0.0
     * @apiParam {String} encryptedData  用户信息的加密数据
     * @apiParam {String} iv  对称解密算法初始向量
     * @apiParam {String} code  code
     * @apiSuccess {JsonObject} result 返回对象
     * @apiSuccess {Integer} result.resultCode 调用是否成功, 1 是 0 否.
     * @apiSuccess {String} result.content 返回的描述性话语, 当resultCode为0时输出异常信息
     *//*

    @ApiOperation(value="onLogin", notes="用户授权登录" , httpMethod = "POST", response = ProjectService.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "encryptedData",value = "用户信息的加密数据",required = true,dataType = "String",paramType="query"),
            @ApiImplicitParam(name = "iv",value = "对称解密算法初始向量",required = true,dataType = "String",paramType="query"),
            @ApiImplicitParam(name = "code",value = "code",required = true,dataType = "String",paramType="query"),
    })
    @PostMapping("/onLogin")
    public String onLogin(String encryptedData, String iv, String code) {
        ReturnJsonResultUtil result = new ReturnJsonResultUtil();
        try {
            if(encryptedData == null || iv == null || code == null) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("参数错误！");
                return result.toString();
            }

            //获取appid和secret
            String customerWxAppInfo = BaseConfigUtil.getConfigVal(tBaseConfigMapper,"customer_wx_app_info");
            if(StringUtil.empty(customerWxAppInfo)) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("没配置微信appid和secret！");
                return result.toString();
            }
            JSONObject customerWxAppJson = JSON.parseObject(customerWxAppInfo);
            String appid = customerWxAppJson.getString("appid");
            String appsercert = customerWxAppJson.getString("appsercert");

            String apiUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appid + "&secret=" + appsercert + "&js_code=" + code + "&grant_type=authorization_code";
            System.out.println(apiUrl);
            HttpRequester http = new HttpRequester();
            HttpRespons respons = http.sendGet(apiUrl);
            JSONObject jsonObject = JSON.parseObject(respons.getContent());
            //解密获取用户信息
            JSONObject userInfoJSON = WechatGetUserInfoUtil.getUserInfo(encryptedData, jsonObject.getString("session_key"), iv);
            if (userInfoJSON != null) {
                TAgentWx tAgentWx = new TAgentWx();
                tAgentWx.setOpenid(userInfoJSON.get("openId")+"");
                List<TAgentWx> tAgentWxs = tAgentWxMapper.select(tAgentWx);
                if(tAgentWxs == null || tAgentWxs.size() == 0) {
                    result.setResultCode(CodeUtil.FAIL);
                    result.setContent("用户还没登录！");
                    return result.toString();
                }
                tAgentWx.setAgentWxId(tAgentWxs.get(0).getAgentWxId());
                tAgentWx.setUnionid(userInfoJSON.get("unionId")+"");
                //然后根据openid去数据库判断有没有该用户信息，若没有则存入数据库，有则返回用户数据
                tAgentWx.setNickname(userInfoJSON.get("nickName")+"");
                tAgentWx.setSex(Integer.parseInt(userInfoJSON.get("gender")+""));
                tAgentWx.setCity(userInfoJSON.get("city")+"");
                tAgentWx.setProvince(userInfoJSON.get("province")+"");
                tAgentWx.setCountry(userInfoJSON.get("country")+"");
                tAgentWx.setHeadimgurl(userInfoJSON.get("avatarUrl")+"");
                tAgentWx.setIsAuth(1);
                int i =tAgentWxMapper.updateByPrimaryKey(tAgentWx);
                result.setMainData(tAgentWx);
            } else {
                result.setContent("解密失败！");
                result.setResultCode(CodeUtil.FAIL);
            }
        }catch (Exception e) {
            result.printLog(request,e);
            result.setContent(CodeUtil.SERVER_ERROR);
            result.setResultCode(CodeUtil.FAIL);
        }
        return result.toString();
    }

    */
/**
     * @api {POST} /userService/getPhone 获取用户手机号
     * @apiName getPhone
     * @apiGroup user
     * @apiDescription  获取用户手机号
     * @apiVersion 1.0.0
     * @apiParam {String} openId  微信用户唯一标识
     * @apiParam {String} encryptedData  用户信息的加密数据
     * @apiParam {String} iv  对称解密算法初始向量
     * @apiParam {String} sessionKey  sessionKey
     * @apiSuccess {JsonObject} result 返回对象
     * @apiSuccess {Integer} result.resultCode 调用是否成功, 1 是 0 否.
     * @apiSuccess {String} result.content 返回的描述性话语, 当resultCode为0时输出异常信息
     *//*

    @ApiOperation(value="getPhone", notes="获取用户手机号" , httpMethod = "POST", response = ProjectService.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "openId",value = "微信用户唯一标识",required = true,dataType = "String",paramType="query"),
            @ApiImplicitParam(name = "encryptedData",value = "用户信息的加密数据",required = true,dataType = "String",paramType="query"),
            @ApiImplicitParam(name = "iv",value = "对称解密算法初始向量",required = true,dataType = "String",paramType="query"),
            @ApiImplicitParam(name = "sessionKey",value = "sessionKey",required = true,dataType = "String",paramType="query"),
    })
    @PostMapping("/getPhone")
    public String getPhone(String openId, String sessionKey, String encryptedData, String iv) {
        ReturnJsonResultUtil result = new ReturnJsonResultUtil();
        try {
            // 登录凭证不能为空
            if(openId == null || encryptedData == null || iv == null || sessionKey == null) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("参数错误！");
                return result.toString();
            }
            byte[] encrypData = Base64.decodeBase64(encryptedData);
            byte[] ivData = Base64.decodeBase64(iv);
            byte[] sessionKeym = Base64.decodeBase64(sessionKey);
            String resultData = decrypt(sessionKeym, ivData, encrypData);
            JSONObject jsonObject = JSONObject.parseObject(resultData); // 转换成JSONObject对象
            Map<String, Object> datamap = jsonObject;

            //写入到数据库
            TAgentWx tAgentWx = new TAgentWx();
            tAgentWx.setOpenid(openId);
            List<TAgentWx> tAgentWxes = tAgentWxMapper.select(tAgentWx);
            tAgentWx = tAgentWxes.get(0);
            tAgentWx.setCountryCode(datamap.get("countryCode")+"");
            tAgentWx.setPhoneNumber(datamap.get("purePhoneNumber")+"");
            int i = tAgentWxMapper.updateByPrimaryKey(tAgentWx);
            result.setMainData(tAgentWx);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result.toString();
    }

    public static String decrypt(byte[] key, byte[] iv, byte[] encData) throws Exception {
        AlgorithmParameterSpec ivSpec = new IvParameterSpec(iv);
        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
        SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
        cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
// 解析解密后的字符串
        return new String(cipher.doFinal(encData), "UTF-8");
    }


    */
/**
     * @api {POST} /userService/exitLogin 退出登录
     * @apiName exitLogin
     * @apiGroup user
     * @apiDescription  退出登录
     * @apiVersion 1.0.0
     * @apiParam {String} openId  微信用户唯一标识
     * @apiSuccess {JsonObject} result 返回对象
     * @apiSuccess {Integer} result.resultCode 调用是否成功, 1 是 0 否.
     * @apiSuccess {String} result.content 返回的描述性话语, 当resultCode为0时输出异常信息
     *//*

    @ApiOperation(value="exitLogin", notes="退出登录" , httpMethod = "POST", response = ProjectService.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "openId",value = "微信用户唯一标识",required = true,dataType = "String",paramType="query"),
    })
    @PostMapping("/exitLogin")
    public String exitLogin(String openId) {
        ReturnJsonResultUtil result = new ReturnJsonResultUtil();
        try {
            // 登录凭证不能为空
            if(openId == null) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("参数错误！");
                return result.toString();
            }
            //写入到数据库
            TAgentWx tAgentWx = new TAgentWx();
            tAgentWx.setOpenid(openId);
            List<TAgentWx> tAgentWxes = tAgentWxMapper.select(tAgentWx);
            if(tAgentWxes == null || tAgentWxes.size() == 0) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("参数错误！");
                return result.toString();
            }
            tAgentWx = tAgentWxes.get(0);
            tAgentWx.setCountryCode(null);
            tAgentWx.setPhoneNumber(null);
            int i = tAgentWxMapper.updateByPrimaryKey(tAgentWx);
            result.setMainData(tAgentWx);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result.toString();
    }
    
    */
/**
     * @api {GET} /userService/getMyApplyLog 查询我的咨询记录
     * @apiName getMyApplyLog
     * @apiGroup user
     * @apiDescription  查询我的咨询记录
     * @apiVersion 1.0.0
     * @apiParam {String} openId  openId
     * @apiSuccess {JsonObject} result 返回对象
     * @apiSuccess {Integer} result.resultCode 调用是否成功, 1 是 0 否.
     * @apiSuccess {String} result.content 返回的描述性话语, 当resultCode为0时输出异常信息
     *//*

    @ApiOperation(value="getMyApplyLog", notes="查询我的咨询记录" , httpMethod = "GET", response = UserService.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "openId",value = "openId",required = true,dataType = "String",paramType="query"),
    })
    @RequestMapping(value = "/getMyApplyLog" , method = RequestMethod.GET)
    public String getMyApplyLog(String openId){
        ReturnJsonResultUtil result = new ReturnJsonResultUtil();
        Map<String, Object> resultMap = new HashMap<String, Object>();
        try{
            if(openId == null) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("参数错误！");
                return result.toString();
            }
            TAgentWx tAgentWx = new TAgentWx();
            tAgentWx.setOpenid(openId);
            List<TAgentWx> tAgentWxs = tAgentWxMapper.select(tAgentWx);
            if(tAgentWxs == null || tAgentWxs.size() == 0) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("找不到用户！");
                return result.toString();
            }
            tAgentWx = tAgentWxs.get(0);
            TUserApplyLog tUserApplyLog = new TUserApplyLog();
            tUserApplyLog.setAgentWxId(tAgentWx.getAgentWxId());
            List<UserApplyLog> userApplyLogs = tUserApplyLogMapper.getUserApplyLogByAgentWxId(tAgentWx.getAgentWxId());
            for(UserApplyLog userApplyLog :userApplyLogs) {
                updatetUserApplyLogInfo(userApplyLog);
            }
            resultMap.put("applyLog", userApplyLogs);
            result.setMainData(resultMap);
        }catch (Exception e) {
            result.printLog(request,e);
            result.setResultCode(CodeUtil.FAIL);
            result.setContent(CodeUtil.SERVER_ERROR);
        }
        return result.toString();
    }



    */
/**
     * @api {GET} /userService/getMyVisitLog 查询用户浏览记录
     * @apiName getMyVisitLog
     * @apiGroup user
     * @apiDescription  查询用户浏览记录
     * @apiVersion 1.0.0
     * @apiParam {String} openId  openId
     * @apiParam {String} type 传"A" 不要传其他类型 A.小程序新房，B.经纪人微店，C.经纪人分享的新房
     * @apiParam {Integer} pageNum 页码
     * @apiParam {Integer} pageSize 查询数量
     * @apiSuccess {JsonObject} result 返回对象
     * @apiSuccess {Integer} result.resultCode 调用是否成功, 1 是 0 否.
     * @apiSuccess {String} result.content 返回的描述性话语, 当resultCode为0时输出异常信息
     *//*

    @ApiOperation(value="getMyVisitLog", notes="查询用户浏览记录" , httpMethod = "GET", response = UserService.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "openId",value = "openId",required = true,dataType = "String",paramType="query"),
            @ApiImplicitParam(name = "type",value = " 传A不要传其他类型  A.小程序新房，B.经纪人微店，C.经纪人分享的新房",required = true,dataType = "String",paramType="query"),
            @ApiImplicitParam(name = "pageNum",value = " 页码",required = false,dataType = "Integer",paramType="query"),
            @ApiImplicitParam(name = "pageSize",value = " 查询数量",required = false,dataType = "Integer",paramType="query"),
    })
    @RequestMapping(value = "/getMyVisitLog" , method = RequestMethod.GET)
    public String getMyVisitLog(String openId, String type, Integer pageNum, Integer pageSize){
        ReturnJsonResultUtil result = new ReturnJsonResultUtil();
        Map<String, Object> resultMap = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<String, Object>();
        try{
            if(openId == null || type == null) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("参数错误！");
                return result.toString();
            }
            TAgentWx tAgentWx = new TAgentWx();
            tAgentWx.setOpenid(openId);
            List<TAgentWx> tAgentWxs = tAgentWxMapper.select(tAgentWx);
            if(tAgentWxs == null || tAgentWxs.size() == 0) {
                result.setResultCode(CodeUtil.FAIL);
                result.setContent("找不到用户！");
                return result.toString();
            }
            tAgentWx = tAgentWxs.get(0);
            TUserVisitLog tUserVisitLog = new TUserVisitLog();
            tUserVisitLog.setAgentWxId(tAgentWx.getAgentWxId());
            tUserVisitLog.setVisitType(type);
            map.put("agentWxId",tAgentWx.getAgentWxId());
            map.put("visitType",type);
            List<UserVisitLog> userVisitLogCount = tUserVisitLogMapper.getMyVisitLog(map);
            //查询分页数据
            if(pageNum != null && pageSize != null) {
                map.put("pageNum", (pageNum - 1) * pageSize);
                map.put("pageSize", pageSize);
            }
            List<UserVisitLog> userVisitLogs = tUserVisitLogMapper.getMyVisitLog(map);
            for (UserVisitLog userVisitLog :userVisitLogs) {
                updatetUserVisitLogInfo(userVisitLog);
            }
            resultMap.put("count", userVisitLogCount == null ? 0: userVisitLogCount.size());
            resultMap.put("sources", userVisitLogs);
            result.setMainData(resultMap);
        }catch (Exception e) {
            result.printLog(request,e);
            result.setResultCode(CodeUtil.FAIL);
            result.setContent(CodeUtil.SERVER_ERROR);
        }
        return result.toString();
    }

    */
/**
     * 修改用户咨询记录的字段后展示在前端
     * @param userApplyLog
     *//*

    private void updatetUserApplyLogInfo(UserApplyLog userApplyLog) {
        if(userApplyLog.getCreateTime() != null) {
            userApplyLog.setCreateTimeStr(DateFormatUtil.formatDateForDay(userApplyLog.getCreateTime()));
        }
        Consultant consultant = tConsultantMapper.getConsultantByConsultantId(userApplyLog.getConsultantId());
        updateConsultantInfo(consultant);
        userApplyLog.setConsultant(consultant);
    }

    */
/**
     * 修改用户浏览记录的字段后展示在前端
     * @param userVisitLog
     *//*


    private void updatetUserVisitLogInfo(UserVisitLog userVisitLog) {
        userVisitLog.setCreateTimeStr(DateFormatUtil.formatDateForDay(userVisitLog.getCreateTime()));
        //如果分享的是房
        if("A".equals(userVisitLog.getVisitType()) || "C".equals(userVisitLog.getVisitType())) {
            TProject tProject = tProjectMapper.selectByPrimaryKey(userVisitLog.getVisitRelId());
            Project project = new Project();
            try{
                ParentValToSubclass.fatherToChild(tProject, project);
            } catch (Exception e) {
                log.error("父类的值赋值到子类异常" + e.getMessage());
            }
            updateProjectInfo(project);
            userVisitLog.setProject(project);
        }
        //如果经纪人微店那么浏览对象id就是用户的id
        if("B".equals(userVisitLog.getVisitType())) {
            //先不管
        }
    }

    */
/**
     * 修改项目的字段后展示在前端
     * @param project
     *//*

    private void updateProjectInfo(Project project) {
        if(project == null) return;
        if(StringUtil.empty(project.getAvgPrice())) {
            project.setAvgPrice("即将开盘");
        } else {
            project.setAvgPrice(project.getAvgPrice()+"元/㎡");
        }
        if(StringUtil.notEmpty(project.getProjectMainPhoto())) {
            String httpsImg = BaseConfigUtil.getConfigVal(tBaseConfigMapper,"https_img");
            project.setProjectMainPhoto(httpsImg + project.getProjectMainPhoto());
        }

        */
/*项目的所有面积集*//*

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("projectId", project.getProjectId());
        List<ProjectHouseType> projectHouseTypes = tProjectHouseTypeMapper.getProjectHouseTypeByMap(map);
        String houseTypeAreas = "";
        for(ProjectHouseType projectHouseType: projectHouseTypes) {
            houseTypeAreas += projectHouseType.getHouseTypeArea() + "㎡/";
        }
        if(houseTypeAreas.length() > 0) {
            houseTypeAreas = houseTypeAreas.substring(0,houseTypeAreas.length()-1);
        }
        project.setHouseTypeAreas(houseTypeAreas);

        */
/*项目的浏览次数*//*

        TProjectData tProjectData = new TProjectData();
        tProjectData.setProjectId(project.getProjectId());
        List<TProjectData> tProjectDatas = tProjectDataMapper.select(tProjectData);
        if(tProjectDatas == null || tProjectDatas.size() == 0) {
            project.setVisitCountShow("没人了解过楼盘情况");
        } else {
            project.setVisitCountShow(tProjectDatas.get(0).getVisitCountShow() + "人了解过楼盘情况");
        }
    }

    */
/**
     * 修改咨询师的字段后展示在前端
     * @param consultant
     *//*

    private void updateConsultantInfo(Consultant consultant) {
        if(StringUtil.empty(consultant.getUserGender())) {
            consultant.setUserGender("未知");
        }else {
            switch (consultant.getUserGender()) {
                case "male": {
                    consultant.setUserGender("男");
                    break;
                }
                case "female": {
                    consultant.setUserGender("女");
                    break;
                }
                default: consultant.setUserGender("未知");break;
            }
        }
        if(StringUtil.notEmpty(consultant.getUserAvatar())) {
            String httpsImg = BaseConfigUtil.getConfigVal(tBaseConfigMapper,"https_img");
            consultant.setUserAvatar(httpsImg + consultant.getUserAvatar());
        } else{
            String agentDefaultImg = BaseConfigUtil.getConfigVal(tBaseConfigMapper,"agent_default_img");
            consultant.setUserAvatar(agentDefaultImg);
        }

        if(consultant.getServiceSatisfaction() == null) {
            consultant.setServiceSatisfactionStr("0");
        } else {
            consultant.setServiceSatisfactionStr(consultant.getServiceSatisfaction() + "%");
            //隐藏
            consultant.setServiceSatisfaction(null);
        }
        if(consultant.getPersonLabel() == null) {
            consultant.setPersonLabels(null);
        } else {
            String[] personLabels = StringUtil.split(consultant.getPersonLabel(),"#");
            consultant.setPersonLabels(personLabels);
            //隐藏
            consultant.setPersonLabel(null);
        }

        if(consultant.getServiceUserCount() == null) {
            consultant.setServiceUserCount(0);
            consultant.setServiceUserCountStr("暂时还没人咨询过他");
        } else{
            consultant.setServiceUserCountStr("咨询人数 " + consultant.getServiceUserCount() +"人");
            //隐藏
            consultant.setServiceSatisfaction(null);
        }

    }

}
*/
